package assistant;

import assistant.dao.CourseDao;
import assistant.dao.EvaluateDao;
import assistant.dao.StudentCourseDao;
import assistant.dao.WishDao;
import assistant.domain.Course;
import assistant.domain.Evaluate;
import assistant.domain.Wish;
import org.junit.Test;
import utils.DAOFactory;

import java.util.Date;
import java.util.List;

/**
 * @Date 2023/1/12 12:39
 * @Author lihu
 */
public class test {

    public CourseDao courseDao = DAOFactory.getInstance().getCourseDao();
    public WishDao wishDao = DAOFactory.getInstance().getWishDao();

    public EvaluateDao evaluateDao = DAOFactory.getInstance().getEvaluateDao();


    @Test
    public void testCourse() {
//        List<Course> courses = courseDao.selectList(null);
//        System.out.println(courses);
        Course course = new Course();
        course.setName("课程1");
        course.setHour(48);
        course.setStudentNumber(90);
        course.setTerm("秋季");
        course.setCourseType(1);
        course.setYear("2022");
        course.setStudentType("研究生");
        course.setTeacherId(1L);
        courseDao.insert(course);
    }

    @Test
    public void testWish() {
//        List<Wish> wishes = wishDao.selectList(null);
//        System.out.println(wishes);

//        Wish wish = new Wish();
//        wish.setStudentId(1L);
//        wish.setCourseId(1L);
//        wish.setOrder("3");
//        wishDao.insert(wish);

        Wish wish = wishDao.selectById(1L);
        System.out.println(wish);
    }

    @Test
    public void testEvaluate() {
//        System.out.println(evaluateDao.selectList(null));
        Evaluate evaluate = new Evaluate();
        evaluate.setStudentId(1L);
        evaluate.setCourseId(1L);
        evaluate.setTeacherId(1L);
        evaluate.setResult("通过");
        evaluate.setSelfEvaluate("尽力了");
        evaluate.setTeacherEvaluate("很好");
        evaluate.setEvaluateTime(new Date());
        evaluateDao.insert(evaluate);
    }
}
